@@ -0,0 +1,5 @@ |
||
| 1 |
+APP_SECRET_TOKEN=notarealappsecrettoken |
|
| 2 |
+TWITTER_OAUTH_KEY=twitteroauthkey |
|
| 3 |
+TWITTER_OAUTH_SECRET=twitteroauthsecret |
|
| 4 |
+THIRTY_SEVEN_SIGNALS_OAUTH_KEY=TESTKEY |
|
| 5 |
+THIRTY_SEVEN_SIGNALS_OAUTH_SECRET=TESTSECRET |
@@ -59,8 +59,6 @@ describe Service do |
||
| 59 | 59 |
stub_request(:post, "https://launchpad.37signals.com/authorization/token?client_id=TESTKEY&client_secret=TESTSECRET&refresh_token=refreshtokentest&type=refresh"). |
| 60 | 60 |
to_return(:status => 200, :body => '{"expires_in":1209600,"access_token": "NEWTOKEN"}', :headers => {})
|
| 61 | 61 |
@service.provider = '37signals' |
| 62 |
- ENV['THIRTY_SEVEN_SIGNALS_OAUTH_KEY'] = 'TESTKEY' |
|
| 63 |
- ENV['THIRTY_SEVEN_SIGNALS_OAUTH_SECRET'] = 'TESTSECRET' |
|
| 64 | 62 |
@service.refresh_token = 'refreshtokentest' |
| 65 | 63 |
@service.refresh_token! |
| 66 | 64 |
@service.token.should == 'NEWTOKEN' |
@@ -1,4 +1,3 @@ |
||
| 1 |
-# This file is copied to spec/ when you run 'rails generate rspec:install' |
|
| 2 | 1 |
ENV["RAILS_ENV"] ||= 'test' |
| 3 | 2 |
|
| 4 | 3 |
if ENV['COVERAGE'] |
@@ -9,6 +8,10 @@ else |
||
| 9 | 8 |
Coveralls.wear!('rails')
|
| 10 | 9 |
end |
| 11 | 10 |
|
| 11 |
+# Required ENV variables that are normally set in .env are setup here for the test environment. |
|
| 12 |
+require 'dotenv' |
|
| 13 |
+Dotenv.load File.join(File.dirname(__FILE__), "env.test") |
|
| 14 |
+ |
|
| 12 | 15 |
require File.expand_path("../../config/environment", __FILE__)
|
| 13 | 16 |
require 'rspec/rails' |
| 14 | 17 |
require 'rspec/autorun' |
@@ -19,7 +22,7 @@ WebMock.disable_net_connect! |
||
| 19 | 22 |
|
| 20 | 23 |
# Requires supporting ruby files with custom matchers and macros, etc, |
| 21 | 24 |
# in spec/support/ and its subdirectories. |
| 22 |
-Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
|
| 25 |
+Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
|
| 23 | 26 |
|
| 24 | 27 |
ActiveRecord::Migration.maintain_test_schema! |
| 25 | 28 |
|